Skip to content

UCAAS-1446 C++ InvokeContext runtime tests and ROSE ownership hardening#137

Merged
JanFellner merged 10 commits into
mainfrom
feature/UCAAS-1446-rose-invoke-context-runtime-tests
Jul 8, 2026
Merged

UCAAS-1446 C++ InvokeContext runtime tests and ROSE ownership hardening#137
JanFellner merged 10 commits into
mainfrom
feature/UCAAS-1446-rose-invoke-context-runtime-tests

Conversation

@JanFellner

@JanFellner JanFellner commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

C++ runtime work for UCAAS-1446. TypeScript gluecode parity is out of scope for this story (separate ticket if needed later).

  • Add 43 InvokeContextRuntimeTest cases (BER + JSON); 113/113 total cpp-lib-sample-runtime-tests passing locally.
  • Harden inbound ROSE dispatch: defer CHOICE choiceId until decode succeeds, gate decode rejects on successful envelope decode, adopt unique_ptr ownership through dispatch.
  • Harden outbound encode with RAII helpers; restore const-correctness and p-prefixed pointer naming on ROSE stub/runtime APIs.
  • Deduplicate inbound decode-failure handling as private SnaccROSEBase methods.
  • Update cpp-lib/tests/runtime_correctness_notes.md (invoke-context lifecycle, ownership, telemetry semantics).
  • Add agent rules: test-specification-first, living documentation.
  • Bump esnacc to 7.0.6 (release 07.07.2026).

Not in this PR

Exploratory ROSE send API pointer refactors (takeInvoke, SnaccScopedInvokeMessage&&, etc.) were tried locally and reverted — branch keeps simple ROSEInvoke* borrow semantics for SendInvoke/SendEvent.

Test plan

  • cpp-lib-sample-runtime-tests — 113/113 passed locally
  • CI green on latest SHA (0096ff9)
  • Review generated OnInvoke(std::unique_ptr&) stub shape for downstream consumers

Jira

https://jira.estos.de/browse/UCAAS-1446

JanFellner and others added 10 commits July 6, 2026 11:48
Tests define expected public API behavior; never tune test or product code to go green unless explicitly asked.
Adds 43 spec tests for custom SnaccInvokeContext on inbound and outbound ROSE paths including failure and orphan scenarios. Test harness uses snapshot-based observation at handler and transport callbacks. 39 pass and 4 fail against current runtime behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
C++ codegen now sets choiceId only after the selected arm decodes successfully, so failed envelope decodes leave a cleared choice. Regenerate SNACCROSE from the updated generator.

Co-authored-by: Cursor <cursoragent@cursor.com>
…code.

Only emit mistypedArgument rejects after ROSEMessage decoding succeeds and
a real invoke is available. Unparsable BER or JSON wire is logged and
telemetried without sending an uncorrelated invokednull reject, matching
common RPC practice for garbage framing.

Move envelope decode and OnROSEMessage into the same guarded try on
OnBinaryDataBlockResult so bRoseEnvelopeDecoded reflects actual decode
state on both inbound paths.

Expect ROSE_TE_TIMEOUT (not ROSE_TE_TRANSPORTFAILED) when a client invoke
never receives a server response; transport failure remains for failed
caller-side sends only.
Move ROSEMessage ownership through the decode and dispatch path with unique_ptr,
snapshot invoke fields for decode-failure rejects, and align the C++ generator
and runtime harness with the updated OnInvoke and sub-message APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace manual prevent-delete nulling in Send/EncodeResult/EncodeError/EncodeReject with RAII helpers, add living-documentation guidance, and align header and correctness-note docs with unique_ptr ownership.

Co-authored-by: Cursor <cursoragent@cursor.com>
Move shared OnBinaryDataBlock decode-failure handling onto SnaccROSEBase and sync runtime_correctness_notes with implemented semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Use const references and pointers for borrow-only envelopes and payloads,
with documented in-place BER JSON logging grafts that restore the owned message.
Use p-prefix names for AsnType and ROSE invoke/reject pointers across runtime interfaces and implementations.
@JanFellner JanFellner changed the title UCAAS-1446 InvokeContext runtime tests and ROSE ownership hardening UCAAS-1446 C++ InvokeContext runtime tests and ROSE ownership hardening Jul 7, 2026
@JanFellner JanFellner merged commit 55e248d into main Jul 8, 2026
5 checks passed
@JanFellner JanFellner deleted the feature/UCAAS-1446-rose-invoke-context-runtime-tests branch July 8, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant